package org.karelun.gef.commands;

import org.eclipse.draw2d.geometry.Point;
import org.karelun.gef.model.AbstractConnectionModel;

public class CreateBendpointCommand extends AbstractCommand{

	private AbstractConnectionModel connection;
	private Point location;
	private int index;
	
	public void execute(){
		connection.addBendpoint(index, location);
	}
	public void setConnection(Object object){
		this.connection=(AbstractConnectionModel)object;
	}
	public void setIndex(int i){
		this.index=i;
	}
	public void setLocation(Point loc){
		this.location=loc;
	}
	public void undo(){
		connection.removeBendpoint(index);
	}
	@Override
	public void redo() {
		execute();
	}
}
